<template>
	<view>
		<uv-navbar
			:leftIconColor="navstyle.txtColor"
			:titleStyle="titleStyle"
			:title="navstyle.title"
			:leftIcon="navstyle.leftIcon"
			:bgColor="navstyle.bgColor"
			:fixed="false"
			@leftClick="leftClick"
			:safeAreaInsetTop="false">
		</uv-navbar>
		<view class="header">
			<image src="../../static/img/team/friendbg.jpg" mode=""></image>
		</view>
		<view class="order_tab">
			<view class="a whole">我的分享</view>
			<view class="meteam">姓名</view>
			<view class="a meteam">佣金</view>
		</view>
		<view>
			<view class="huiyuan" v-for="(item,index) in teamList" :key="index">
				<view class="huiyuan-style">
					<view class="huiyuan-name">
						{{item.username}}
					</view>
					<view class="huiyuan-name">
						{{item.nickname}}
					</view>
					<view class="huiyuan-dengji">
						<text>{{item.money}}</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {getFandAndTeam} from '@/api/team.js';
	export default{
		onLoad(options) {
			this.type = options.type;
			getFandAndTeam(this.type).then(response => {
				// console.log(response,4444)
				this.teamList = response.data;
			});
			
		},
		data(){
			return{
				navstyle: {
					title: "我的市场",
					txtColor: "#333333",
					bgColor: "#FFFFFF",
					leftIcon: "arrow-left",
				},
				titleStyle: {
					fontWeight: 700
				},
				type:"",
				teamList:[],
			}
		},
		methods:{
			leftClick() {
				uni.reLaunch({
				  url: '/pages/team/myteam_info' // 返回到
				})
			},
		}
	}
</script>

<style>
	.header image{
	    width: 100%;
	    height: 150px;
		
	}
	.order_tab {
	    background-color: #f1f1f1;
	    border-radius: 5px;
		align-items: center;
	    display: flex;
	    justify-content: space-between;
	    padding: 10px;
	    color: #666;
	    font-size: 14px;
	}
	.order_tab .whole {
	    font-weight: 700;
	    color: green;
	    border-bottom: green solid 2px;
	}
	.order_tab .a {
	    padding: 5px 0;
	    margin: 0 24px;
	}
	.meteam{
	    padding: 5px 0;
	}
	.huiyuan-style {
	    border: 1px solid #f1f1f1;
	    padding: 0 10px;
	    border-top: 0;
	    line-height: 40px;
	    display: flex;
	    flex-direction: row;
	}
	.huiyuan-name{
	    width: 37%;
	    text-align: center;
	    font-size: 14px;
	    overflow: hidden;
	    white-space: nowrap;
	}
	.huiyuan-dengji{
	    margin: 0 auto;
	    font-size: 13px;
	    line-height: 20px;
	}
	.huiyuan-dengji text{
	    display: block;
	    background-color: #fff270;
	    color: red;
	    padding: 3px 10px;
	    border-radius: 20px;
	    margin: 7px auto;
	}
</style>